// 引入本地服务器
import request from 'request'
import mockAxios from './mockAxios'
// 获取品牌推荐页数据列表
export const mockBrandData = (limit, page) => mockAxios({
    url: `/tradeList/${limit}/${page}`,
    method: 'GET'
})

// 修改推荐状态
export const mockChangeState = (id, data1) => mockAxios({
    url: `/changeItem/trideItem/${id}`,
    method: 'POST',
    data: {
        code: data1
    }
})



// 获取品牌列表
export const reqGetSkuList = (limit,page) => mockAxios({
    url: `/tradeList/${limit}/${page}`,
    method:"get"
})

// 品牌模糊查询
export const reqGetSkuOfkey = (key) => mockAxios({
    url: `/tradeOne?trade=${key}`,
    method:"get"
})
// 品牌根据id查询
export const reqGetSkuById = (_id) => mockAxios({
    url: `/tradeOne/${_id}`,
    method:"get"
})


// 删除推荐品牌
export const mockDeleteBrand = (id) => mockAxios({
    url: `/dele/tradeItem/${id}`,
    method: 'get'
})
// 搜索品牌
export const mockSearchData = (keyword,flag) =>mockAxios({
    url:`/tradeOne?key=${keyword}&code=${flag}`,
    method: 'get'
})
// 商品列表数据
export const mockCommoditylist = (page,limit) => mockAxios({ 
    url:`/shopList/${page}/${limit}`,
    method: 'GET'
})
// 删除信息
export const mockCommoditydelete= (id) => mockAxios({ 
    url:`/deleItem/${id}`,
    method: 'get'
})
// 添加商品信息
// post      /shopItem/create      {id:Number,
//     categoryId:Number,
//     name: String, 
//     mainImage:String, 
//     price: Number, 
//     status:Number, 
//     imageHost:String, 

//     num:Number
// }

// 添加信息
export const mockCommodityadd=(data)=> mockAxios({ 
    url:"/shopItem/create",
    method: 'post',
    data,
})

// 编辑商品数据
export const mockeditor =(data={},id) =>mockAxios({
    url:`/changeShop/${id}`,
    method: 'post',
    data,
})
// 获取指定id的信息
// /shopOne/:id
export const mockCommodityId =(id) =>mockAxios({
    url:`/shopOne/${id}`,
    method: 'get'
})
//获取用户列表信息
export const getUserList = (limit,page)=> mockAxios.get(`/userList/${limit}/${page}`)

//删除某一条用户信息
export const getDeleUserInfo = (id) => mockAxios.get("/dele/userItem/"+id)

//模糊搜索
export const getFindUserList = (key,value) => mockAxios.get(`/userOne/find?${key}=${value}`)

export const getChangeUserInfo = (id,data) => mockAxios({
  method:"POST",
  url:`/changeItem/userItem/${id}`,
  data
})
//添加用户信息
export const postAddUserInfo = (data) => mockAxios({
  method:"POST",
  url:"/add/createUserInfo",
  data
})

//添加品牌信息
export const mockAddSku = (data) => mockAxios({
    url: "/addTradeMark/item",
    method: "post",
    data
})

// 删除品牌
export const mockDeleSku = (id) => mockAxios({
    url: `/dele/tradeItem/${id}`,
    method:"get"
})

// 查查询品牌信息
export const mockSeleSku = (keyword,flag=true) => mockAxios({
    url: `/tradeOne?key=${keyword}&code=${flag}`,
    method:"get"
})

// 修改商品信息
export const mockUpdateSku = (id,data) => mockAxios({
    url: `/changeItem/trideItem/${id}`,
    method: 'post',
    data
})






export { default as permission } from './acl/permission';export { default as role } from './acl/role'
// export {default as permission} from './acl/permission'
export * as user from './acl/user'

